<template>
<div class='page'>
  <navTop title="会议签到码"></navTop>
  <div class="h100"></div>
  <div class="code">
    <img id="code" src="~@/assets/img/huiyi/code.png" alt="">
  </div>
  <div class="btn" @click="saveAsImage">保存图片</div>
</div>
</template>
<script>
import navTop from '@/components/navTop.vue'
import { news } from '@/api/api.js'
export default {
  components: {
    navTop
  },
  data() {
    return {
      typeList: [
        {name:'全部',id:''},
        {name:'已报名',id:'1'},
        {name:'已签到',id:'2'},
        {name:'已完成',id:'3'},
        {name:'未参加',id:'4'},
      ],
      type_id: 0,
      
      total: 0,
      page: 1,
      isfinish: false,
      isLoad: true,
      list: [],
      img:''
    }
  },
  created() {
    this.img = this.$route.query.img
  },
  watch: {

  },
  methods: {
    saveAsImage() {
      // 创建一个图片元素
      var img = new Image();
      img.src = this.img
      
      // 创建一个链接元素用于下载图片
      var link = document.createElement('a');
      link.target = '_blank'
      link.href = img.src;
      link.download = 'saved-image.png';
      link.click();
    },
  }
}
</script>
<style lang="scss" scoped>
.nav{
	width: 100%;
	position: fixed;
	top: 0;
	left: 0;
	background-color: rgba($color: #fff, $alpha: 1);
	z-index: 10;
	transition: all 0.5s;
}
.input_div{
	width: 100%;
  height: 40px;
	.nav_title{
		font-weight: 500;
		font-size: 18px;
		color: #000;
	}
}

.page{
	height:100%;
	width:100%;
	background: #fff;;
  .total{
    margin-left: 10px;
    font-size: 10px;
    color: #333333;
  }
}
.code{
  width: 260px;
  height: 260px;
  display: block;
  margin: 0 auto;
  img{
    width: 100%;
    height: 100%;
  }
}
.btn{
  margin: 68px auto;
  width: 260px;
  height: 45px;
  text-align: center;
  line-height: 45px;
  background: #FA8A26;
  border-radius: 3px;
  font-weight: bold;
  font-size: 18px;
  color: #FFFFFF;
}
</style>